#pragma once
#include <vector>
#include <string>
#include <cstring>
#include<regex>
using namespace std;
class Symbol;
class Result;
class Relation;
class WithClause;
class Pattern;

class Preprocessor {
public:
	void process(string input);
	Preprocessor();

	Symbol* getSymbolTable();
	Result* getResultList();
	Relation* getRelationList();
	WithClause* getWithList();

private:
	bool readChar(vector<string> input,unsigned int* position, char character);
	bool readDeclaration(vector<string> input,unsigned int* position, string type);
	bool readResultCl(vector<string> input,unsigned int* position);
	bool readSuchThatCl(vector<string>input,unsigned int*position);
	bool readWithCl(vector<string>input, unsigned int*position);
	bool readPatternCl(vector<string>input, unsigned int*position);
	vector<string> tokenize(string input);
	vector<regex> createRegex();
	Symbol* symbolTable;
	Result* resultList;
	Relation* relationList;
	WithClause* withList;

};